package cn.shop.admin.service.impl;

import cn.shop.admin.service.BlacklistService;
import cn.shop.transcation.blacklist.entity.Blacklist;
import cn.shop.transcation.blacklist.mapper.BlacklistMapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author : 李一涵
 * @date : Created in 2021-11-8 17:10
 * @description : 黑名单service
 */
@Service
public class BlacklistServiceImpl extends ServiceImpl<BlacklistMapper, Blacklist> implements BlacklistService {

	/**
	 * 删除黑名单
	 *
	 * @param ids 黑名单编号
	 */
	@Override
	public boolean deleteBlacklist(List<Long> ids) {
		int count = getBaseMapper().batchDeleteWithFill(new Blacklist(), Wrappers.<Blacklist>lambdaQuery()
				.in(Blacklist::getId, ids));
		return count > 0;
	}

}
